﻿<?php
require_once('../global.php');
require_once('sqinc/phplibs/Slim-2.6.2/Slim/Slim.php');
require_once('sqinc/inc/common.inc.php');
require_once('functions.php');

use \Slim\Slim as Slim;

Slim::registerAutoloader();

$app = new Slim(array('templates.path' => 'api/info/doc'));

$app->get(
    '/',
    function() use($app){
		$app->render('index.php', array(
			'api_name' => 'ADAA健身房接口文档',
			'api_list' => array(
				array('name' => '协议', 'kind' => array(
					array('name' => 'agreement', 'summary' => '协议'),
					array('name' => 'contract', 'summary' => '会员购买特权合同')
				)),
				array('name' => '验证码', 'kind' => array(
					array('name' => 'captcha', 'summary' => '发送验证码')
				)),
				array('name' => '会员', 'kind' => array(
					array('name' => 'member/mobile/check', 'summary' => '验证手机号'),
					array('name' => 'member/register', 'summary' => '注册'),
					array('name' => 'member/login', 'summary' => '登录'),
					array('name' => 'member/password/find', 'summary' => '找回密码'),
					array('name' => 'member/password/update', 'summary' => '修改密码'),
					array('name' => 'member/paypassword/update', 'summary' => '修改交易密码'),
					array('name' => 'member/paypassword/updatebycaptcha', 'summary' => '修改交易密码（通过短信验证码）'),
					array('name' => 'member/paypassword/check', 'summary' => '验证交易密码'),
					array('name' => 'member/info', 'summary' => '查询用户信息'),
					array('name' => 'member/nickname/update', 'summary' => '修改昵称'),
					array('name' => 'member/head/update', 'summary' => '修改头像'),
					array('name' => 'member/realinfo/update', 'summary' => '会员真实信息填写')
				)),
				array('name' => '教练', 'kind' => array(
					array('name' => 'coach/mobile/check', 'summary' => '验证手机号'),
					array('name' => 'coach/register', 'summary' => '注册'),
					array('name' => 'coach/login', 'summary' => '登录'),
					array('name' => 'coach/reapply', 'summary' => '重新申请'),
					array('name' => 'coach/password/find', 'summary' => '找回密码'),
					array('name' => 'coach/password/update', 'summary' => '修改密码'),
					array('name' => 'coach/paypassword/update', 'summary' => '修改交易密码'),
					array('name' => 'coach/paypassword/updatebycaptcha', 'summary' => '修改交易密码（通过短信验证码）'),
					array('name' => 'coach/paypassword/check', 'summary' => '验证交易密码'),
					array('name' => 'coach/info', 'summary' => '查询用户信息'),
					array('name' => 'coach/nickname/update', 'summary' => '修改昵称'),
					array('name' => 'coach/head/update', 'summary' => '修改头像'),
					array('name' => 'coach/intro', 'summary' => '查询用户资料'),
					array('name' => 'coach/intro/update', 'summary' => '修改资料')
				)),
				array('name' => '提现帐号', 'kind' => array(
					array('name' => 'bindbank/bind', 'summary' => '绑定提现账号'),
					array('name' => 'bindbank/unbind', 'summary' => '解绑提现账号'),
					array('name' => 'bindbank/get', 'summary' => '获取当前绑定状态')
				)),
				array('name' => '反馈', 'kind' => array(
					array('name' => 'feedback/add', 'summary' => '添加反馈')
				)),
				array('name' => '打卡', 'kind' => array(
					array('name' => 'sign/add', 'summary' => '打卡'),
					array('name' => 'sign/gym/info', 'summary' => '健身房打卡信息'),
					array('name' => 'sign/info', 'summary' => '打卡信息')
				)),
				array('name' => '关注', 'kind' => array(
					array('name' => 'follow/add', 'summary' => '关注'),
					array('name' => 'follow/delete', 'summary' => '取消关注'),
					array('name' => 'follow/list', 'summary' => '关注列表')
				)),
				array('name' => '课程', 'kind' => array(
					array('name' => 'curriculum/coach/list', 'summary' => '教练列表'),
					array('name' => 'curriculum/coach/info', 'summary' => '教练详情'),
					array('name' => 'curriculum/list', 'summary' => '课程列表'),
					array('name' => 'curriculum/info', 'summary' => '课程详情'),
					array('name' => 'curriculum/add', 'summary' => '课程添加'),
					array('name' => 'curriculum/edit', 'summary' => '课程编辑'),
					array('name' => 'curriculum/takeup', 'summary' => '课程上架'),
					array('name' => 'curriculum/takedown', 'summary' => '课程下架'),
					array('name' => 'curriculum/type/list', 'summary' => '课程类型列表'),
					array('name' => 'curriculum/mine', 'summary' => '我的课程')
				)),
				array('name' => '健身房', 'kind' => array(
					array('name' => 'gym/list', 'summary' => '健身房列表'),
					array('name' => 'gym/detail', 'summary' => '健身房详情'),
					array('name' => 'gym/onlineuser', 'summary' => '健身房在线会员'),
					array('name' => 'gym/login', 'summary' => '健身房登录记录'),
					array('name' => 'gym/trade', 'summary' => '健身房交易记录'),
					array('name' => 'gym/place/curriculum', 'summary' => '健身房场地课程和新闻')
				)),
				array('name' => '场地', 'kind' => array(
					array('name' => 'place/list', 'summary' => '场地(新闻)列表'),
					array('name' => 'place/info', 'summary' => '场地详情'),
					array('name' => 'place/reserveinfo', 'summary' => '预约场地详情'),
					array('name' => 'place/time', 'summary' => '场地时间详情'),
					array('name' => 'place/mine', 'summary' => '我的场地'),
					array('name' => 'place/curriculum/info', 'summary' => '场地课程详情'),
					array('name' => 'place/curriculum/add', 'summary' => '场地课程添加'),
					array('name' => 'place/curriculum/mine', 'summary' => '我的场地课程')
				)),
			    
			    array('name' => '团队课', 'kind' => array(
			        array('name' => 'group/curriculum/info', 'summary' => '团队课程详情'),
			        array('name' => 'group/curriculum/list', 'summary' => '团队课程列表'),
			        array('name' => 'group/curriculum/mine', 'summary' => '我的团队课程')
			    )),
			    
				array('name' => '二维码', 'kind' => array(
					array('name' => 'qrcode/sign', 'summary' => '打卡二维码信息'),
					array('name' => 'qrcode/pay', 'summary' => '付款二维码信息')
				)),
                array('name' => '特权', 'kind' => array(
                    array('name' => 'privilege/list', 'summary' => '特权列表')
                )),
				array('name' => '订单', 'kind' => array(
					array('name' => 'order/curriculum/add', 'summary' => '创建课程订单'),
					array('name' => 'order/privilege/add', 'summary' => '创建特权订单'),
					array('name' => 'order/place/add', 'summary' => '创建场地订单'),
					array('name' => 'order/place/curriculum/add', 'summary' => '创建场地课程订单'),
				    array('name' => 'order/group/curriculum/add', 'summary' => '创建团队课程订单'),
					array('name' => 'order/good/add', 'summary' => '创建商品订单'),
//					array('name' => 'order/get', 'summary' => '订单列表'),
//					array('name' => 'order/info', 'summary' => '订单详情'),
				)),
				array('name' => '交易', 'kind' => array(
					array('name' => 'trade/add', 'summary' => '新增交易记录'),
					array('name' => 'trade/get', 'summary' => '资金变动记录'),
					array('name' => 'trade/detail', 'summary' => '资金变动详情'),
				    array('name' => 'trade/alipay/web/synchronize', 'summary' => '支付宝web同步请求交易回调'),
				    array('name' => 'trade/alipay/web/asynchronize', 'summary' => '支付宝web异步请求交易回调'),
				    array('name' => 'trade/gen_trade', 'summary' => '生成交易'),
				    array('name' => 'trade/wechat/web/asynchronize', 'summary' => '微信web异步请求交易回调'),
				    array('name' => 'trade/pay/alipay', 'summary' => '支付宝支付'),
				    array('name' => 'trade/pay/wxpay', 'summary' => '微信支付')
				)),
				array('name' => '提现', 'kind' => array(
					array('name' => 'withdraw/add', 'summary' => '申请提现'),
					array('name' => 'withdraw/get', 'summary' => '提现列表'),
					array('name' => 'withdraw/delete', 'summary' => '取消提现'),
				)),
                array('name' => 'ADAA', 'kind' => array(
					array('name' => 'adaa/transfer', 'summary' => 'ADAA转账'),
					array('name' => 'adaa/get', 'summary' => 'ADAA明细')
				)),
                array('name' => '健康数据', 'kind' => array(
					array('name' => 'health/info', 'summary' => '我的健康数据'),
					array('name' => 'health/baseinfo', 'summary' => '我的基本信息'),
					array('name' => 'health/info/7day', 'summary' => '我的健康数据七天数据'),
					array('name' => 'health/baseinfo/7day', 'summary' => '我的基本信息七天数据'),
					array('name' => 'health/baseinfo/edit', 'summary' => '添加/编辑我的基本信息'),
					array('name' => 'health/info/edit', 'summary' => '添加/编辑我的健康信息')
				)),
                array('name' => '评价', 'kind' => array(
					array('name' => 'evaluate/add', 'summary' => '新增评价'),
					array('name' => 'evaluate/list', 'summary' => '评价列表'),
                    array('name' => 'evaluate/coach_list', 'summary' => '教练评价列表')
				)),
                array('name' => '预约', 'kind' => array(
					array('name' => 'retention', 'summary' => '课程预约'),
					array('name' => 'retention/undo', 'summary' => '取消预约/驳回预约'),
					array('name' => 'retention/check', 'summary' => '教练确认预约'),
					array('name' => 'retention/start', 'summary' => '教练确认开始上课'),
					array('name' => 'retention/end', 'summary' => '确认上课结束'),
					array('name' => 'retention/coach/layout', 'summary' => '教练排期'),
					array('name' => 'retention/list', 'summary' => '预约列表')
				)),
				array('name' => '新闻', 'kind' => array(
					array('name' => 'news/detail', 'summary' => '新闻详情')
				)),

//				array('name' => 'order/get', 'summary' => '获取订单列表'),
//				array('name' => 'order/info', 'summary' => '获取订单详情'),
//				array('name' => 'order/add', 'summary' => '从商品详情页创建订单'),
//				array('name' => 'order/addfromcart', 'summary' => '从购物车创建订单'),
//				array('name' => 'order/addfromwish', 'summary' => '添加许愿池订单'),
//				array('name' => 'order/close', 'summary' => '关闭订单'),
//				array('name' => 'order/payment', 'summary' => '支付订单'),
//				array('name' => 'order/confirm', 'summary' => '确认订单已收货'),
//				array('name' => 'order/delete', 'summary' => '删除订单'),
//				array('name' => 'order/goodget', 'summary' => '根据商品快照id获取商品相关信息和订单状态'),
//				array('name' => 'order/good/comment', 'summary' => '订单商品评价'),
//				array('name' => 'withdraw/add', 'summary' => '申请提现'),
//				array('name' => 'withdraw/get', 'summary' => '提现列表'),
//				array('name' => 'withdraw/delete', 'summary' => '取消提现')
			)
		));
    }
);

require('info/agreement.php');
require('info/captcha.php');
require('info/member.php');
require('info/coach.php');
require('info/bindbank.php');
require('info/feedback.php');
require('info/sign.php');
require('info/follow.php');
require('info/curriculum.php');
require('info/gym.php');
require('info/place.php');
require('info/qrcode.php');
require('info/privilege.php');
require('info/order.php');
require('info/trade.php');
require('info/withdraw.php');
require('info/adaa.php');
require('info/health.php');
require('info/evaluate.php');
require('info/retention.php');
require('info/news.php');
require('info/group.php');

$app->run();
?>
